data("bodyfat", package="TH.data")
myFormula <- DEXfat ~ age + waistcirc + hipcirc + elbowbreadth + kneebreadth
# 设置响应变量服从正态分布，对应的连接函数服从对数分布
bodyfat.glm <- glm(myFormula, family = gaussian("log"), data = bodyfat)
# 预测类型为响应变量
pred <- predict(bodyfat.glm, type="response")
plot(bodyfat$DEXfat, pred, xlab="Observed Values", ylab="Predicted Values")
abline(a=0, b=1)